using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class InitManager : MonoBehaviour
{
    public enum ShopPlatform
    {
        Editor,
        TapTap,
        Google,
    }
    public ShopPlatform targetShopPlatform;
    public Image image;
    public Text text;
    public float time = 1.6f;
    public AnimationCurve curve;
    public string targetScene
    {
        get
        {
            return "Menu";
        }
    }
    public void Start()
    {
        Color color = new Color(1, 1, 1, 0);
        IEPool_Manager.instance.KeepTimeToDo(null, time, null, (_time) => {
            color.a = Mathf.Lerp(0, 1, curve.Evaluate(1 - _time / time));
            image.color = color;
            text.color = color;
            return true;
        },()=> {
            color.a = 0;
            image.color = color;
            text.color = color;
            IEPool_Manager.instance.WaitTimeToDo(null, 1, null, () => {
                LoadScene_Manager.instance.LoadScene(targetScene);
            });
        });
    }

    void InitLanguage(string parameter)
    {
        if (string.IsNullOrEmpty(PlayerPrefs.GetString("Language")))
        {
            PlayerPrefs.SetString("Language",parameter);
        }
    }
}
